from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
import time
testCase="DBshop018_删除属性组"
groupName="好好学习"
# 1.点击“删除”按钮，确认删除，删除成功。
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
time.sleep(1)
DBshopEnterMenu3(firefox,"商品管理","商品属性","属性分组")
firefox.find_element_by_xpath(
    "//td[text()='%s']/following-sibling::td[2]/a[2]"%groupName).click()
time.sleep(1)
firefox.switch_to.alert.accept()
time.sleep(2)
try:
    if firefox.find_element_by_xpath("//td[text()='%s']"%groupName).is_displayed():
        writeLog("%s 测试失败" % testCase)
        getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
    time.sleep(2)
firefox.quit()